package com.auto.sns.core.dao.impl;

import java.util.List;
import java.util.Map;

import com.system.common.Page;
import com.auto.sns.core.domain.SnsCoreVote;
import com.auto.sns.core.dao.ISnsCoreVoteDAO;
import com.system.util.PersistUtil;
import com.auto.sns.core.sql.sqlid.SnsCoreActivitySqlID;
import com.auto.sns.core.sql.sqlid.SnsCoreVoteSqlID;
/**
 * : t_auto_sns_core_vote
 * 
 * 
 * @author Gen
 */
public class SnsCoreVoteDAOImpl implements ISnsCoreVoteDAO{

	public SnsCoreVote insertSnsCoreVote(SnsCoreVote bean){
		return PersistUtil.insert(bean, SnsCoreVoteSqlID.INSERT);
	}

	public boolean deleteSnsCoreVote(String scvoGuid){
		PersistUtil.delete(scvoGuid, SnsCoreVoteSqlID.DELETE);
		return true;
	}	

	public SnsCoreVote updateSnsCoreVote(SnsCoreVote bean){
		return PersistUtil.update(bean, SnsCoreVoteSqlID.UPDATE);
	}	

	public SnsCoreVote loadSnsCoreVote(String scvoGuid){
		return PersistUtil.query(new SnsCoreVote().getClass(), scvoGuid);
	}

	public List<SnsCoreVote> queryList(Map<String,Object> param,Page page){
		page.setCount(PersistUtil.countSpecial(param, SnsCoreVoteSqlID.QUERY));
		return PersistUtil.querySpecial(param, SnsCoreVoteSqlID.QUERY, page.getFullOrderBy(), page.getOffset(), page.getLimit());
	}

	public boolean updateReplyNum(String scvoGuid) {
		PersistUtil.update(scvoGuid, SnsCoreActivitySqlID.UPDATE_REPLY_NUM);
		return true;
	}

	public boolean updateRecommendNum(String scvoGuid) {
		PersistUtil.update(scvoGuid, SnsCoreActivitySqlID.UPDATE_RECOMMEND_NUM);
		return true;
	}

	public boolean updateFavoriteNum(String scvoGuid) {
		PersistUtil.update(scvoGuid, SnsCoreActivitySqlID.UPDATE_FAVORITE_NUM);
		return true;
	}

}
